<style>
	.button-table{
		margin-top:10px;
		margin-left:26px;
	}
</style>
<link type="text/css" rel="stylesheet" href="<?php echo $this->config->item('plugin_path');?>popup/jquery.fancybox.css" />
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>popup/jquery.fancybox.js"></script>
<div class="row">
	<div class="col-lg-12">
		<div class="panel panel-default gradient">
			<div class="panel-heading">
				<h4>
					<span>Grid Pengaduan & Saran dari Pemohon</span>
				</h4>
			</div>
			<div class="panel-body noPad clearfix">
				<table cellpadding="0" id="tabel" cellspacing="0" border="0" class="dynamicTable display table table-bordered" width="100%">
					<thead>
						<tr>
							<th><center>No.</center></th>
							<th>Nama</th>
							<th>No. Telepon</th>
							<th>Email</th>
							<th>Isi</th>
							<th>Media</th>
							<th>Tanggal</th>
							<th>Ijin</th>
							<th>No. UPTSA</th>
							<th>Pemilahan</th>
						</tr>
					</thead>
					<tbody>
						<?php $no = 0; foreach($data_ps_pemohon as $row){ $no++;?>
							<tr class="odd gradeX">
								<td><center><?php echo $no;?></center></td>
								<td><?php echo $row['NAMA'];?></td>
								<td><?php echo $row['NO_TELPON'];?></td>
								<td><?php if($row['EMAIL']==NULL){echo "-";}else{echo $row['EMAIL'];}?></td>
								<td><?php echo $row['ISI'];?></td>
								<td><?php 
									if($row['MEDIA'] == 1){
										echo "LANGSUNG";
									}elseif($row['MEDIA'] == 2){
										echo "TELEPON";
									}elseif($row['MEDIA'] == 3){
										echo "EMAIL";
									}elseif($row['MEDIA'] == 4){
										echo "WEBSITE";
									}else{
										echo "-";
									}
								?></td>
								<td><?php echo date('d-m-Y', strtotime($row['TANGGAL']));?></td>
								<td><?php if($row['KD_IJIN'] != NULL){echo $row['NAMA_IJIN'];}else{ echo "-";}?></td>
								<td><?php if($row['NO_UPTSA'] != NULL){echo $row['NO_UPTSA'];}else{ echo "-";}?></td>
								<td>
									<div class="control center">
										<a class="fancybox" href="#inline1" onClick="pemilahan(<?php echo $row['KD_PS_PEMOHON'];?>,'<?php echo $row['ISI'];?>')" title="Pemilahan Data" class="tip"><span class="icon14 cut-icon-popout-2"></span></a>
									</div>
								</td>
							</tr>
						<?php }?>
					</tbody>
				</table>
				<div id="inline1" style="width:400px;display: none;">
					<center><h3>Termasuk jenis masukan ?</h3></center>
					<textarea class="form-control elastic" rows="5" name="isi" id="isi" readonly></textarea>
					<br>
					<center><button type="button" onClick="savetopengaduan()" class="btn btn-default">Pengaduan</button>&nbsp;<button type="button" onClick="savetosaran()" class="btn btn-default">Saran</button></center>
					<div id="j_pengaduan">
						<br>
						<?php echo form_open('pengaduan_saran/savetopengaduan')?>
						<input type="text" name="id" id="id" style="display:none;">
						<select name="j_pengaduan" id="j_pengaduan" >
							<option value="1">keterlambatan SK/retribusi</option>
							<option value="2">petugas</option>
							<option value="3">sarana prasarana</option>
							<option value="4">lingkungan kerja</option>
							<option value="5">mekanisme prosedur</option>
						</select>
						<br>
						<br>
						<center><button type="submit" class="btn btn-default">Simpan</button></center>
						<?php echo form_close()?>
					</div>
					<div id="j_saran">
						<br>
						<?php echo form_open('pengaduan_saran/savetosaran')?>
						<input type="text" name="id" id="id2" style="display:none;">
						<select name="j_saran" id="j_saran">
							<option value="1">Biaya</option>
							<option value="2">SDM</option>
							<option value="3">Waktu Penyelesaian</option>
							<option value="4">Metode - Prosedur</option>
							<option value="5">Dokumen Persyaratan</option>
							<option value="6">Sarana Prasarana</option>
						</select>
						<br>
						<br>
						<center><button type="submit" class="btn btn-default">Simpan</button></center>
						<?php echo form_close()?>
					</div>
				</div>
			</div>
			
		</div>
	</div>
</div>

<link href="<?php echo $this->config->item('plugin_path');?>tables/dataTables/jquery.dataTables.css" type="text/css" rel="stylesheet" />
<link href="<?php echo $this->config->item('plugin_path');?>tables/dataTables/TableTools.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>tables/dataTables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>tables/dataTables/TableTools.min.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>tables/dataTables/ZeroClipboard.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>tables/responsive-tables/responsive-tables.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('js_path');?>datatable.js"></script>
<script type="text/javascript" src="<?php echo $this->config->item('plugin_path');?>misc/nicescroll/jquery.nicescroll.min.js"></script>
<script>

function savetopengaduan(){
	//var id = $('#id').val();
	// document.location="<?php echo site_url("pengaduan_saran/savetopengaduan");?>/"+id;
	$('#j_saran').hide('slow');
	$('#j_pengaduan').show('slow');
	
}
function savetosaran(){
	// var id = $('#id').val();
	// document.location="<?php echo site_url("pengaduan_saran/savetosaran");?>/"+id;
	$('#j_pengaduan').hide('slow');
	$('#j_saran').show('slow');
}
function pemilahan(id,isi){
	$("#id").val(id);
	$("#id2").val(id);
	$("#isi").val(isi);
}
$(document).ready(function (){
	$('.fancybox').fancybox();
	$('#j_pengaduan').hide();
	$('#j_saran').hide();
	
});
</script>